package com.nmc.service.manager.impl;

import java.util.List;

import org.springframework.security.authentication.encoding.PasswordEncoder;

import com.nmc.service.dao.CommentsDao;
import com.nmc.service.manager.CommentsManager;
import com.nmc.service.model.Comments;

/**
 * Implementation of CommentsManager interface.
 * 
 * @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
 */
public class CommentsManagerImpl extends GenericManagerImpl<Comments, Long> implements
		CommentsManager {

	private CommentsDao commentsDao;


	public void setCommentsDao(CommentsDao commentsDao) {
		this.dao = commentsDao;
		this.commentsDao = commentsDao;
	}

	/**
	 * {@inheritDoc}
	 */
	public Comments getComments(String commentsId) {
		return commentsDao.get(new Long(commentsId));
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Comments> getCommentss() {
		return commentsDao.getAllDistinct();
	}

	/**
	 * {@inheritDoc}
	 */
	public Comments saveComments(Comments comments) {

		return commentsDao.saveComments(comments);

	}

	/**
	 * {@inheritDoc}
	 */
	public void removeComments(String commentsId) {
		log.debug("removing comments: " + commentsId);
		commentsDao.remove(new Long(commentsId));
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Comments> search(String searchTerm) {
		return super.search(searchTerm, Comments.class);
	}
}
